# Contributor: Miguel Terron <miguel.a.terron@gmail.com>
# Maintainer: Miguel Terron <miguel.a.terron@gmail.com>
pkgname=mawk
pkgver=1.3.4
_pkgdate=20230808
pkgrel=7
pkgdesc="mawk is an interpreter for the AWK Programming Language"
url="https://invisible-island.net/mawk/"
arch="all"
license="GPL-2.0-only"
subpackages="$pkgname-doc"
source="https://invisible-island.net/archives/mawk/mawk-$pkgver-$_pkgdate.tgz"
builddir="$srcdir"/$pkgname-$pkgver-$_pkgdate

build() {
	# implicit decls for srandom/environ
	CFLAGS="$CFLAGS -D_GNU_SOURCE" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
fbf860a70d2e919018a44e43351c2558737a6694c416c17bc1669b5fa18bebedfefbfe3edddaa28143d0445d838c38958b28a92d85d03ef2f2af6d94737abe2c  mawk-1.3.4-20230808.tgz
"
